import { createRouter, createWebHistory } from 'vue-router'; // 导入 Vue Router

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'login',
      component: () => import('../views/Login/LogIn.vue'),
    },
    {
      path: '/mainPage',
      name: 'mainPage',
      component: () => import('../views/mainPage/mainPage.vue'),
      children: [
        {
          path: '',
          name: 'home',
          component: () => import('../views/Home/Home.vue'),
        },
        {
          path: 'project',
          name: 'project',
          component: () => import('../views/project/project.vue'),
        },
        {
          path: 'resource',
          name: 'resource',
          component: () => import('../views/resource/resource.vue'),
        },
        {
          path: 'task',
          name: 'task',
          component: () => import('../views/task/task.vue'),
        },
        {
          path: 'team',
          name: 'team',
          component: () => import('../views/team/team.vue'),
        },
        {
          path: 'role',
          name: 'role',
          component: () => import('../views/role/role.vue'),
        },
      ],
    },
  ],
});

export default router;